home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / _GUICtrlTreeViewGetTree.au3 < prev    next >
Text File  |  2006-08-04  |  1KB  |  47 lines

  1. #include <WindowsConstants.au3>
  2. #include <GuiTreeView.au3>
  3. #include <GuiStatusBar.au3>
  4.  
  5. opt("MustDeclareVars", 1)
  6.  
  7. Global Const $Turquoise = 0x40e0d0
  8. Global Const $Crimson = 0xDC143C
  9. Global Const $White = 0xFFFFFF
  10.  
  11. Dim $hGUI, $treeview, $nItem1, $nItem2, $nItem3
  12. Dim $nSubItem1, $nSubItem2, $nSubItem3, $nSubItem4
  13. Dim $nButton, $Status, $nMsg
  14.  
  15. $hGUI = GUICreate("TreeView Item Get Tree", 392, 254)
  16.  
  17. $treeview = GUICtrlCreateTreeView(10, 10, 150, 150)
  18. $nItem2 = GUICtrlCreateTreeViewItem("Item2", $treeview)
  19. $nItem1 = GUICtrlCreateTreeViewItem("Item1", $treeview)
  20. $nSubItem2 = GUICtrlCreateTreeViewItem("SubItem2", $nItem1)
  21. $nSubItem1 = GUICtrlCreateTreeViewItem("SubItem1", $nItem1)
  22. $nSubItem4 = GUICtrlCreateTreeViewItem("SubItem4", $nSubItem1)
  23. $nSubItem3 = GUICtrlCreateTreeViewItem("SubItem3", $nSubItem1)
  24.  
  25. $nButton = GUICtrlCreateButton("Path?", 70, 170, 70, 20)
  26. $Status = _GuiCtrlStatusBarCreate($hGUI, -1, "")
  27. _GuiCtrlStatusBarSetSimple($Status)
  28.  
  29. _GUICtrlTreeViewSetBkColor($treeview, $Turquoise)
  30. _GUICtrlTreeViewSetTextColor($treeview, $Crimson)
  31. _GUICtrlTreeViewSetLineColor($treeview, $White)
  32. _GUICtrlTreeViewSetIndent($treeview, 30)
  33.  
  34. GUISetState()
  35.  
  36. While 1
  37.     $nMsg = GUIGetMsg()
  38.     Select
  39.         Case $nMsg = $GUI_EVENT_CLOSE
  40.             ExitLoop
  41.         Case $nMsg = $nButton
  42.             _GuiCtrlStatusBarSetText($Status,"Path: " & _GUICtrlTreeViewGetTree($treeview, "\"),255)
  43.     EndSelect
  44. WEnd
  45.  
  46. Exit
  47.